<template>
    


    <h2>{{ msg }}</h2>
    <input type="text" v-model="msg">

    <h2>{{ customMsg }}</h2>
    <input type="text" v-model="customMsg">
</template>

<script lang="ts" setup name="CustomRef">
import { customRef, ref } from 'vue';
import useMsgRef from '@/hooks/useMsgRef'
//默认的ref，数据一发生变化，页面立即更新
let msg = ref('你好')
let {customMsg} = useMsgRef('尚硅谷', 500)

</script>

<style scoped>
</style>